int balancedStringSplit(char *s)
{
    int len = strlen(s);
    int idx;
    int res = 0;
    int lCnt = 0;
    char lStr = 'x';
    for (idx = 0; idx < len; idx++)
    {
        if (lStr == 'x')
        {
            lStr = s[idx];
            lCnt++;
            continue;
        }

        if (lStr == s[idx])
        {
            lCnt++;
        }
        else
        {
            /* 出现不等 */
            lCnt--;
            if (lCnt == 0)
            {
                /* 匹配完毕统计计数增加 */
                lStr = 'x';
                res++;
            }
        }
    }

    return res;
}